package cn.jbolt.ai.klb;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public enum DocLinkType {

    LINK_TYPE_ANSWER("answer", "回答"),
    LINK_TYPE_DOC("doc", "文档");



    private String code;
    private String description;


    // 私有构造函数
    private DocLinkType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static List<Map<String, Object>> toList() {
        return java.util.Arrays.stream(DocLinkType.values())
                .map(type -> {
                    Map<String, Object> map = new java.util.HashMap<>();
                    map.put("value", type.getCode());
                    map.put("text", type.getDescription());
                    return map;
                })
                .collect(Collectors.toList());
    }
}
